<template>
  <div>
    <el-button @click="showDialog = !showDialog">显示表单</el-button>

<!--    <common-form-->
<!--        title="编辑字典"-->
<!--        :show.sync="showDialog"-->
<!--        :form-attr="formAttr"-->
<!--        :default-data="defaultData"-->
<!--        @onSubmit="submitHandle"-->
<!--    ></common-form>-->

    <cxs-table
        :selectable=true
        :table-data="tableData"
        :table-attr="tableAttr"
        :show-view="!hasAuth('sys:user:view')"
        :show-edit="hasAuth('sys:user:update')"
        :show-delete="hasAuth('sys:user:delete')"
        @handleSearch="handleSearch"
        @viewClick="handleView"
        @editClick="handleEdit"
        @deleteClick="handleDelete"
        @selectionChange="selectChange">
    </cxs-table>

  </div>
</template>

<script>
import data from "./data";

export default {
  name: "DictIndex",
  components: {
  },
  data() {
    return data
  },
  methods: {
    submitHandle(data) {
      if (data.id) {
        // 编辑
      } else {
        // 新增
      }
      console.log(data)
    },
    handleSearch(data) {
      console.log({...data})
    },
    handleView(row) {
      console.log({...row})
    },
    handleEdit(row) {
      console.log({...row})

    },
    handleDelete(row) {
      console.log({...row})

    },
    selectChange(rows) {
      console.log(rows)
    }
  }
}
</script>

<style scoped>

</style>